Image reading device, image forming apparatus, method of replacing a part of shading reference data, and recording medium

ABSTRACT

An image reading device includes: a scanner having characteristics of causing a distortion of gradation including a sine wave being formed by its obtained image data and being represented as an array of gradation values arranged in a main scanning direction; a reference member to be scanned; a hardware processor that: obtains a gradation value at each main scanning position from shading reference data obtained from the reference member; determines a target range in the shading reference data based on the gradation value at the each main scanning position; generates a substitute part of data to be replaced for an original part of data in the target range; and replaces the original part of data with the substitute part of data while the gradation values at the start and end phase of the substitute part of data are adjusted to the same of the target range.

The disclosure of Japanese Patent Application No. 2017-001744, filed onJan. 10, 2017, including description, claims, drawings, and abstract, isincorporated herein by reference in its entirety.

BACKGROUND Technological Field

The present invention relates to: an image reading device that reads animage on a document and is to be used in an image forming apparatus, forexample; an image forming apparatus provided with this image readingdevice; a method of replacing a part of shading reference data; and arecording medium.

Description of the Related Art

An image reading device with a contact image sensor (CIS) is known as acommon image reading device to be used in image processing apparatuses.Such an image reading device has a scanner that is provided with: alight source comprised of, for example, a light-emitting diode (LED); alight-receptive lens array such as a SELFOC lens array; and a linesensor, which are all disposed at their predetermined positions suchthat the light source emits light to a document and the line sensorreads an image on a document with the reflected light.

An image reading device with a SELFOC lens array as a light-receptivelens array is known for its characteristic of causing its line sensor toobtain scanned data having a cyclical distortion of gradation like asine wave that is represented as an array of gradation values (shadevalues) arranged in a main scanning direction. A long-term use of suchan image reading device is a cause of time-dependent deterioration ofthe line sensor (causes a phase shift, for example) and the light source(causes a reduction in the amount of light, for example), resulting in alower image quality (particularly, low white level pixels).

To prevent a distortion of gradation and a lower image quality due totime-dependent deterioration as described above, such an image readingdevice with a SELFOC lens array is configured to perform shadingcorrection. In shading correction, the line sensor reads a whitesheetlike reference member that is referred to as a shading referenceplate and corrects white level values with reference to shadingreference data obtained from the reference member.

Such a reference member for shading correction may have foreignparticles of paper and toner dust from a document, on its surface. Inthis case, when the line sensor reads the reference member, the foreignparticles cause low white level values (dark pixels) in the shadingreference data. When the line sensor reads a document after that,shading correction is performed such that the pixels in the scanneddata, corresponding to the dark pixels in the shading reference data,becomes brighter, which results in streaks extending in a sub-scanningdirection on a document image.

To solve this problem, the image reading device can be further providedwith a rotating mechanism that rotates the reference member and acleaning mechanism that cleans the reference member such that thereference member is cleaned up while being rotated at a predeterminedtiming. However, this will require room for the rotating and cleaningmechanism, conflicting with the trend toward device miniaturization.

Alternatively, it can be considered that a part of data in a distortedwaveform range due to foreign particles is removed from the shadingreference data obtained from the reference member and a substitute partfor shading correction obtained and stored in advance, for example, isembedded in place of it.

Japanese Unexamined Patent Application Publication No. 2015-026957discloses a scanner device that performs shading correction.Specifically, a low-pass filter circuit extracts a broadly distortedpart that is a cause of uneven shades, from the waveform made by a lightsource and a sensor affected by time-dependent deterioration andtemperature characteristics; a phase and amplitude modulation circuitextracts a phase-shifted part from the cyclic pattern made by a lensarray; using these extracted waveform elements, a multiplier circuitcomposes an image signal waveform for correction. The image signalwaveform for correction is removed from an image signal waveformobtained by dark level correction (offset processing).

It can be considered that a part of data in a distorted waveform rangedue to foreign particles is replaced with a corrected part of data.However, the deteriorating members eventually cause discontinuity inshade value in the boundary between the original and substitute part ofdata since they change the characteristic of shading reference dataobtained from a reference member, with lapse of time.

The technology disclosed in Japanese Unexamined Patent ApplicationPublication No. 2015-026957 is not a technology of removing a part ofdata in a distorted waveform range from the shading reference data andembedding a substitute part of data in place of it. So, it does notbring a solution to the present problem, failing to preventdiscontinuity in shade value in the boundary between an original andsubstitute part of data in the shading reference data.

SUMMARY

The present invention, which has been made in consideration of such atechnical background as described above, is capable of preventingstreaks on a document image obtained by shading correction, by ensuringcontinuity in shade value in the boundary between an original andsubstitute part of data in a distorted waveform range in shadingreference data.

A first aspect of the present invention relates to an image readingdevice including:

-   a scanner that obtains image data by scanning an image, the scanner    having characteristics of causing a distortion of gradation    including a sine wave, the distortion of gradation being formed by    the image data, the distorted sine wave being represented as an    array of gradation values arranged in a main scanning direction;-   a reference member to be scanned by the scanner for shading    correction; and-   a hardware processor that:-   obtains a gradation value at each main scanning position from    shading reference data, the shading reference data obtained by the    scanner from the reference member;-   determines a target range in the shading reference data based on the    gradation value at the each main scanning position, the target range    including a distorted waveform range in the shading reference data;-   generates a substitute part of data to be replaced for an original    part of data in the target range; and-   replaces the original part of data in the target range with the    substitute part of data while the gradation values at the start and    end phase of the substitute part of data are adjusted to the    gradation values at the start and end phase of the target range in    the shading reference data,    wherein the hardware processor generates the substitute part of data    by using a sine wave on the basis of a trigonometric function    obtained from the shading reference data.

A second aspect of the present invention relates to a method ofreplacing a part of shading reference data for an image reading device,the image reading device including:

-   a scanner that obtains image data by scanning an image, the scanner    having characteristics of causing a distortion of gradation    including a sine wave, the distortion of gradation being formed by    the image data, the distortion of gradation being represented as an    array of gradation values arranged in a main scanning direction; and-   a reference member to be scanned by the scanner for shading    correction,    the method including:-   obtaining a gradation value at each main scanning position from    shading reference data, the shading reference data obtained by the    scanner from the reference member;-   determining a target range in the shading reference data based on    the gradation value at the each main scanning position, the target    range including a distorted waveform range in the shading reference    data;-   generating a substitute part of data to be replaced for an original    part of data in the target range; and-   replacing the original part of data in the target range with the    substitute part of data while the gradation values at the start and    end phase of the substitute part of data are adjusted to the    gradation values at the start and end phase of the target range in    the shading reference data,    wherein the substitute part of data is generated by using a sine    wave on the basis of a trigonometric function obtained from the    shading reference data.

BRIEF DESCRIPTION OF THE DRAWINGS

The advantages and features provided by one or more embodiments of theinvention will become more fully understood from the detaileddescription given hereinbelow and the appended drawings which are givenby way of illustration only, and thus are not intended as a definitionof the limits of the present invention.

FIG. 1 illustrates a comprehensive configuration of an image formingapparatus provided with an image reading device according to oneembodiment of the present invention;

FIG. 2A schematically illustrates a configuration of an automaticdocument feeder 10 and an image reading device 20 in a front view of theimage forming apparatus; FIG. 2B illustrates a configuration of ascanner unit from FIG. 2A;

FIG. 3 is a block diagram illustrating a functional configuration of aCPU;

FIG. 4A is a waveform chart of shading reference data obtained from ashading reference sheet by a scanning sensor in the early stages of useof the image forming apparatus; FIG. 4B is an enlarged view of a part ofthe waveform;

FIG. 5A is a waveform chart of shading reference data obtained by thescanning sensor when the waveform characteristic has changed bytime-dependent deterioration; FIG. 5B is an enlarged view of a part ofthe waveform;

FIG. 6 is a view for reference in describing a method of determining thetarget range for data replacement;

FIG. 7 is a flowchart representing a process of determining the targetrange for data replacement;

FIG. 8 is a view for reference in describing a method of determining thetarget range for data replacement when a foreign particle causes astriking difference in shade value;

FIG. 9 is a lookup table for detecting peaks for defining the start andend position of the target range for data replacement;

FIG. 10 is a flowchart representing a process of determining the targetrange for data replacement when a foreign particle causes a strikingdifference in shade value;

FIG. 11 is a view for reference in describing a process of consolidatingmultiple target ranges for data replacement into one when these areadjacent to each other;

FIG. 12 is a flowchart representing a process of consolidating multipletarget ranges for data replacement into one;

FIGS. 13A to 13D are views for reference in describing a process ofretaining multiple target ranges for data replacement withoutconsolidating even when these are adjacent to each other;

FIG. 14 is a flowchart representing a process of consolidating multipletarget ranges for data replacement into one on the condition that thesetarget ranges show similar characteristics of shading reference datawhen these are adjacent to each other;

FIG. 15 is a view for reference in describing a method of generating asubstitute part of data;

FIG. 16 is a view for reference in describing another method ofgenerating a substitute part of data;

FIG. 17 is a view for reference in describing yet another method ofgenerating a substitute part of data;

FIGS. 18A and 18B are views for reference in describing a process ofensuring continuity in the boundaries between the original andsubstitute part of data in the shading reference data;

FIG. 19 is a flowchart representing a data replacement process; and

FIGS. 20A and 20B illustrate another example of a target range.

DETAILED DESCRIPTION OF EMBODIMENTS

Hereinafter, one or more embodiments of the present invention will bedescribed with reference to the drawings. However, the scope of theinvention is not limited to the disclosed embodiments.

FIG. 1 illustrates a comprehensive configuration of an image formingapparatus provided with an image reading device according to oneembodiment of the present invention. As illustrated in this figure, theimage forming apparatus is essentially provided with an automaticdocument feeder (ADF) 10, a document reader 20, an imaging portion 30,an automatic duplexer 40, a sheet feeder 50, a paper cabinet 60, anoperation panel 70, a facsimile unit 90, a communication interface (I/F)unit 91, a controller 100, and a memory 120.

The automatic document feeder 10 is publicly known as a device thatautomatically conveys multiple sheets of document put on a sheet feedertray 12, one after another, to a document scanning positionpredetermined on a platen that is the surface of a scanner glass of thedocument reader 20 and that pushes out a sheet of document onto adocument sheet output tray every time the document reader 20 finishesreading it. The automatic document feeder is provided with a documentplacement sensor 11. The document placement sensor 11, comprised of apublicly known tactile switch, judges whether or not a document isproperly placed and transmits the result of judgment to the controller100 by signal.

The document reader 20 scans an image on a sheet of document at thedocument scanning position in a suitable manner for the paper size orother conditions. Subsequently, the document reader 20 receives lightemitted by a light source toward the sheet of document and reflectedtherefrom, as an incident ray, converts the incident ray to electricalsignals, then transfers them to the controller 100 as image data. Thedocument reader 20 is provided with a device lift sensor 21. The devicelift sensor 21, comprised of a publicly known magnetic sensor, judgeswhether or not the automatic document feeder 10 is lifted and transmitsthe result of judgment to the controller 100 by signal.

The operation panel 70 is publicly known as a user interface, and isprovided with a display 71 serving as a touchscreen entry portion and akey entry portion 72. The operation panel 70 is further provided with asecondary power switch 80. The secondary power switch 80 is a switchthat allows the user to manually switch the operation mode to sleep modethat is a power-saving mode.

The controller 100 controls the entire image forming apparatus in aunified and systematic manner. For example, the controller 100 performsvarious data processing tasks such as shading correction on the scannedimage received and outputs signals to drive a laser diode along everymain scanning line in synchronization with a sheet of paper beingsupplied. In this embodiment, before reading a document image, thecontroller 100 further obtains shading reference data for shadingcorrection and performs a process of replacing a part of the shadingreference data, which will be later described in detail.

The facsimile unit 90 is an interface for connecting a public telephonenetwork and transmitting and receiving image data through the network.

The communication I/F unit 91 is an interface for connecting to externalnetworks and communicating with personal computers and other apparatusesthat belong to the networks. The external networks represent LANs andUSBs.

The memory 120 stores image data received from the controller 100 andother data. The memory 120 is comprised of a hard disk drive (HDD), forexample.

The imaging portion 30 forms an image by an electro-photographic methodthat is widely known. The imaging portion 30 is provided withphoto-conductor drums 31 a, 31 b, 31 c, and 31 d, photo-conductorexposure units 32 a, 32 b, 32 c, and 32 d, a transfer belt 33, a frontcover sensor 34, and, although it is not shown in this figure, a frontcover for protecting all the preceding portions. The imaging portion 30forms a four-color image for yellow, magenta, cyan, and black printing.In accordance with signals received from the controller 100, thephoto-conductor exposure units 32 a, 32 b, 32 c, and 32 d generate laserlight and expose the surfaces of the photo-conductor drums 31 a, 31 b,31 c, and 31 d with the laser light. The front cover sensor 34 iscomprised of a publicly known tactile switch and judges whether or notthe front cover is open and transmits the result of judgment to thecontroller 100 by signal. The transfer belt 33 receives CMYK tonerimages from the surfaces of the photo-conductor drums 31 a, 31 b, 31 c,and 31 d one after another and transfers them onto a sheet of paper thatis delivered from the sheet feeder 50.

The sheet feeder 50 is provided with paper cassettes 51 and 53 forloading sheets of paper and paper pickup rollers 52 and 54 for pickingup the sheets of paper therefrom one after another. The sheet feeder 50feeds the sheets of paper into the imaging portion 30.

Similarly, the paper cabinet 60 is provided with paper cassettes 61 and63 for loading sheets of paper and paper pickup rollers 62 and 64 forpicking up the sheets of paper therefrom one after another. The papercabinet 60 feeds the sheets of paper into the imaging portion 30 by wayof the sheet feeder 50.

The automatic duplexer 40 enables duplex printing by switching thedirection of conveyance to its opposite to turn a sheet of paper withprinting on one side, upside down, and feeding the sheet of paper again.

FIG. 2A schematically illustrates a configuration of the automaticdocument feeder 10 and the image reading device 20 in a front view ofthe image forming apparatus.

The automatic document feeder 10 is an automatic document feeder of aspecific type commonly referred to as a sheet-through type, and conveysa target sheet of document to the image scanner 20. The automaticdocument feeder 10 may further have a function of scanning the reverseside of the sheet of document.

The image scanner 20 creates image data by reading an image on a sheetof document conveyed by the automatic document feeder 10.

As illustrated in FIG. 2A, the image scanner 20 is essentially comprisedof: a scanner unit 206 provided with a photosensor; a platen 205; and ashading reference sheet 207, and reads a document image.

The automatic document feeder 10 is provided with a feed roller 220, aseparation roller 221, and a pre-scan conveyance roller 201; theserollers convey a sheet of document put on the sheet feeder tray 12 tothe scanning position. The scanner unit 206 creates image data in RGBformat. The post-scan conveyance roller 202 is positioned adjacent tothe scanning position but in the lower reaches of the documentconveyance path. After a sheet of document passes through the scanningposition, the post-scan conveyance roller 202 conveys the sheet ofdocument downstream to output to a paper output tray 222. Meanwhile, thesheet of document is guided to the scanning position by a conveyance andguide member 223 in such a manner that allows it to be conveyed in acontactless manner with the platen 205. The post-scan conveyance roller202 drives a little faster than the pre-scan conveyance roller 201 suchthat the sheet of document is stretched taut enough to keep from contactwith the platen 205.

Although it is not shown in the figure, the sheet feeder tray 12 of theautomatic document feeder 10 has a guide member that prevents sheets ofdocument from being fed in a tilted manner by guiding them in position,and the guide member is coupled with a position sensor. The sheet feedertray 12 further has multiple document sensors arranged in a conveyancedirection. A combination of the position sensor and the document sensorsallows judging the size of sheets of document put on the sheet feedertray 12. The scanner unit 206 may slide to the position of the shadingreference sheet 207 that is a white reference member and perform shadingcorrection on a regular basis during a job.

In this embodiment, the scanner unit 206 is provided with a scanningsensor comprised of a single linear array contact image sensor.Specifically, as illustrated in FIG. 2B, the scanner unit 206 isprovided with: a light source 206 a that emits light to a sheet ofdocument 300; a lens array 206 b that receives light reflected from thesheet of document 300; and a scanning sensor (line sensor) 206 ccomprised of a linear array image sensor disposed immediately underneaththe lens array 206 b; all these are aligned in a cross direction of thesheet of document 30 i.e. in a main scanning direction.

In this embodiment, the light source 206 c is comprised of LEDs of thethree colors: red (R), green (G), and blue (B). The controller 100 turnson and off the light source 206 c by controlling a light driving circuit110.

The scanning sensor 206 c of the scanner unit 206 obtains image data byphotoelectric conversion and transfers it to a data obtaining portion120. The data obtaining portion 120 is comprised of an analog front-end(AFE) that performs A/D conversion on analog signals from the scanningsensor 206 i.e. that converts the analog signals to digital signals.

The controller 100 is provided with a CPU 101, a ROM 102, and a RAM 103.The CPU 101 controls the entire image forming apparatus in a unified andsystematic manner; the control operations include turning on and off thelight source 206 a and performing processing on the digital imagesignals obtained by the data obtaining portion 120.

The ROM 102 is a memory that stores operation programs for the CPU 101and other data; the RAM 103 is a memory that provides a workspace forthe CPU 101 to execute the operation programs.

To scan both front and back sides of a sheet of document, the imageforming apparatus may be further provided with a reversing mechanismthat turns a sheet of document upside down such that the sheet ofdocument is conveyed to the scanning position twice sequentially for thescanning of the front and back sides, or may be further provided with adedicated scanning unit to the scanning of the back side.

The CPU 101 receives shading reference data, which is the scanned dataobtained from the shading reference sheet 207 by the scanning sensor 206c, from the data obtaining portion 120. To perform shading correction,the CPU 101 determines the target range including a distorted waveformrange in the shading reference data and replaces an original part ofdata in the target range with a substitute part of data. This processingwill be further described below with reference to the block diagram ofFIG. 3, illustrating a functional configuration of the CPU 101.

As referred to FIG. 3, the data obtaining portion 120 inputs the shadingreference data which is obtained from the shading reference sheet 207 bythe scanning sensor 206 c, to a shade value obtaining portion 131.

From the shading reference data, the shade value obtaining portion 131obtains the shade values of all pixels i.e. the shade values at all mainscanning positions (main scanning coordinates).

FIG. 4A is a waveform chart of shading reference data SH0 obtained fromthe shading reference sheet 207 by the scanning sensor 206 c in theearly stages of use of the image forming apparatus; FIG. 4B is anenlarged view of a part of the waveform. The transverse axis representsthe position of pixel counted along a main scanning direction, and thelongitudinal axis represents shade values of the same. The rightwardmain scanning direction (a direction to the right end of paper) isdefined as a positive direction, and the leftward main scanningdirection is defined as a negative direction.

As previously described, if the lens array 206 b is a SELFOC lens array,for example, the data obtaining portion 120 obtains image data having acyclical distortion of gradation extending in a main scanning direction.So, as shown in FIG. 4B, the shading reference data SH0 forms anapproximate sine wave with a positive and negative peak in every cycle.In the early stages of use of the image forming apparatus, the lightsource 206 a and the lens array 206 b of the scanner unit 206 maintaintheir normal qualities without deterioration, the scanning sensor 206 cof the scanner unit 206 also maintains its normal quality withoutsubstrate deformation, and the shading reference sheet 207 does not haveyet foreign particles of paper and toner dust from a document. At thistime, the shade values at the main scanning coordinates of all positivepeaks in the shading reference data SH0 are approximately the same, andthe shade values at the main scanning coordinates of all negative peaksin the shading reference data SH0 are approximately the same. In theearly stages of use of the image forming apparatus, shading referencedata (hereinafter to be referred to as initial shading reference data)is stored on the memory 120 or another recording medium. Alternatively,before shipment, initial shading reference data may be obtained andstored thereon at the factory.

After a long-term use of the image forming apparatus, the light source206 a and the lens array 206 b of the scanner unit 206 lose their normalqualities because of deterioration, and the scanning sensor 206 c of thescanner unit 206 also loses its normal quality because of substratedeformation. At this time, as is understood from the shading referencedata SH1 in FIG. 5A, the waveform extending in a main scanning directionis widely curved. FIG. 5B is an enlarged view of a part of the waveformof FIG. 5A. As shown in FIG. 5B, a foreign particle of toner or paperdust at a position on the shading reference sheet 207 causes adistortion (noise) 400 at the corresponding position in the waveform.

A noise range determination portion 132 detects the start and endposition of a distorted waveform range (hereinafter to be also referredto as a noise range) in the shading reference data SH1. In thisembodiment, as shown in FIG. 6, the shade values obtained by the shadevalue obtaining portion 131 form a distorted sine wave, and the noiserange determination portion 132 detects the start position Hstr and theend position Hend by searching for two breakpoints in the distorted sinewave. The noise range determination portion 132 may detect the startposition Hstr and the end position Hend by searching for two strikingchanges in the distorted sine wave. The noise range W is determined bythe start position Hstr and the end position Hend.

A target range determination portion 133 determines the target range, apart of data in which will be replaced with a substitute part of data.As shown in FIG. 6, the shading reference data SH1 forms a distortedsine wave with multiple peaks in shade value. The target rangedetermination portion 133 defines the start position Hpstr as the mainscanning coordinate of a peak P1 that is within a reference distance REFto the left (to the negative direction) of the start position Hstr ofthe noise range W determined by the noise range determination portion132. Similarly, the target range determination portion 133 defines theend position Hpend as the main scanning coordinate of a peak P2 that iswithin a reference distance REF to the right (to the positive direction)of the end position Hend of the noise range W determined by the same.

The target range R1 is determined by the start position Hpstr and theend position Hpend. The reference distance REF is determined in advancewith reference to the cycles of the shading reference data SH0 such thatone peak, the peak P1 for defining the start position Hpstr of thetarget range R1, is to the left of the noise range W and one peak, thepeak P2 for defining the end position Hpend of the target range R1, isto the right of the noise range W.

Subsequently, a data replacement portion 140 removes an original part ofdata in the target range R1 from the shading reference data SH1 andembeds a substitute part of data in place of it. The data replacementprocess will be later described in detail.

As described above, in this embodiment, the start position Hpstr and theend position Hpend of the target range R1 are defined as the mainscanning coordinates of the peaks P1 and P2 in a sine wave. So, thetarget range R1 is extremely small; this extremely small target rangecontributes to the precision of continuity in the boundary. Withreference to corrected shading reference data obtained in this manner,shading correction can be successfully performed. The image formingapparatus is thus allowed to prevent streaks on an image by ensuringcontinuity in shade value in the boundary between an original andsubstitute part of data. Furthermore, in this embodiment, the startposition Hpstr of the target range R1 is defined as the main scanningcoordinate of the peak P1 that is within a predetermined range to theleft of the start position Hstr of the distorted waveform range W, andthe end position Hpend of the target range R1 is defined as the mainscanning coordinate of the peak P2 that is within a predetermined rangeto the right of the end position Hend of the distorted waveform range W.So, the target range R1 is limited to the extent absolutely necessary.

FIG. 7 is a flowchart representing the above-described process ofdetermining the target range for data replacement. The image formingapparatus performs the processes represented by the flowcharts of FIG. 7and the following figures, by the CPU 101 running operation programsstored on a recording medium such as the ROM 12.

In Step S01, the start position Hstr and the end position Hend of thedistorted waveform range (noise range) W are detected. In Step S02, themain scanning coordinate of the peak P1 that is within the predeterminedreference distance REF to the left (to the negative direction) of thestart position Hstr of the noise range W is obtained; the range is from(Hstr−REF) to Hstr in other words. In Step S03, the cutoff position (thestart position Hpstr of the target range R1) is defined as the mainscanning coordinate of the peak P1 which is obtained in the previousstep.

Subsequently, in Step S04, the main scanning coordinate of the peak 2that is within the predetermined reference distance REF to the right (tothe positive direction) of the end position Hend of the noise range W isobtained; the range is from Hend to (Hend+REF) in other words. In Step505, the end position Hpend (of the target range R1) is defined as themain scanning coordinate of the peak P2 which is obtained in theprevious step.

In another case, it is absolutely possible that a foreign particlecauses a striking difference in shade value and a very low minimum shadevalue, which is the distortion 400 indicated in FIG. 8. In this case,the distortion 400 impacts on the shade values of the peaks P3 and P4that are to the left and right of and adjacent to the same noise range Wwhich is determined by the same start position Hstr and the same endposition Hend. If the start position Hpstr of the target range R1 isdefined as the main scanning coordinate of the peak P3 that is to theleft of and adjacent to the noise range W and the end position Hpend ofthe target range R1 is defined as the main scanning coordinate of thepeak P4 that is to the right of and adjacent to the noise range W, thequality of shading correction will be compromised because the distortion400 further impacts on the shade values beyond the target range R1. So,in this case, it is preferred that the start position Hpstr of thetarget range R1 be defined as the main scanning coordinate of the peakP5 that is further to the left and the end position Hpend of the targetrange R1 be defined as the main scanning coordinate of the peak P6 thatis further to the right.

In this embodiment, the target range R1 should be wider when a foreignparticle causes a striking difference in shade value, which will befurther described below.

The target range determining portion 133 obtains the minimum shade valuein the noise range W and the shade value at the main scanningcoordinates of a peak that is within the predetermined referencedistance REF to the right or left of the noise range W, with referenceto the shade values at all main scanning coordinates, which are obtainedby the shade value obtaining portion 131. The target range determiningportion 133 then calculates the difference between the shade value atthe peak and the minimum shade value in the noise range W.

Meanwhile, a lookup table determines the reference distance REF fordetecting the peaks for defining the start position Hpstr and the endposition Hpend of the target range R, depending on the differencebetween the shade value at the peak and the minimum shade value in thenoise range W. This table is stored in advance on a recording mediumsuch as the ROM 103. FIG. 9 shows an example of this lookup table.

In the lookup table of FIG. 9, the minimum shade value in the noiserange W is represented by Vmin; the shade value at the main scanningcoordinate of a peak that is within the predetermined reference distanceREF to the right or left of the noise range W is represented by V; andthe difference between the shade value at the peak and the minimum shadevalue in the noise range W is represented by the expression V−Vmin.Furthermore, a first reference distance to the left of the startposition Hstr of the noise range W and a first reference distance to theright of the end position Hend of the noise range W are each representedby REFn1; a second reference distance to the left of the start positionHstr of the noise range W and a second reference distance to the rightof the end position Hend of the noise range W are each represented byREFn2. While the relationship between REFn1 and REFn2 can be representedby the inequality REFn2>REFn1; V−Vmin is configured to be directlyproportional to both REFn1 and REFn2. By calculating V−Vmin, the targetrange determination portion 133 obtains the difference between the shadevalue Vat the main scanning coordinate of a peak that is within thepredetermined reference distance REF to the right or left of the noiserange W, and the minimum shade value in the noise range W. The targetrange determination portion 133 then obtains REFn1 and REFn2 thatcorrespond to V−Vmin from the lookup table. The target rangedetermination portion 133 obtains the shade value at a peak that iswithin the first reference distance REFn1 to the left of the startposition Hstr of the noise range W and the shade value at a peak that iswithin the first reference distance REFn2 to the right of the endposition Hend of the noise range W. Similarly, the target rangedetermination portion 133 further obtains the shade value at a peak thatis within the second reference distance REFn2 to the left of the startposition Hstr of the noise range W and the shade value at a peak that iswithin the second reference distance REFn2 to the right of the endposition Hend of the noise range W.

As described above, the minimum shade value Vmin in the noise range Wand the shade value V at a peak that is within the predeterminedreference distance REF to the right or left of the noise range W areobtained. The difference between the shade value V at the peak and theminimum shade value Vmin is obtained by calculating V−Vmin, and thereference distances (REFn1 and REFn2) that correspond to V−Vmin areobtained from the lookup table. With these reference distances, peaksfor defining the start position Hpstr and the end position Hpend of thetarget range R1 are detected. The image forming apparatus is thusallowed to successfully define the start position Hpstr and the endposition Hpend of the target range R1 depending on the degree of theimpact of the distortion 400 i.e. depending on the condition of aforeign particle.

FIG. 10 is a flowchart representing a process of determining a targetrange R1 when a foreign particle causes a striking difference in shadevalue.

In Step S11, the start position Hstr and the end position Hend of thedistorted waveform range (noise range) W are detected. In Step S12, theminimum shade value Vmin in the noise range W is obtained; in Step S13,the shade value V at a peak that is within the predetermined referencedistance REF to the right or left of the noise range W is obtained. InStep S14, REFn1 and REFn2 that correspond to the difference V−Vmin areobtained from the lookup table (LUT).

In Step S15, the main scanning coordinate of a peak that is within therange from the position the first reference distance REFn1 to the left(to the negative direction) of the start position Hstr of the noiserange W to the position the second reference distance REFn2 to the left(to the negative direction) of the start position Hstr of the noiserange W is obtained; the range is from (Hstr−REFn1) to (Hstr−REFn2) inother words. In Step S16, the cutoff position (the start position Hpstrof the target range R1) is defined as the main scanning coordinate ofthe peak which is obtained in the previous step.

Subsequently, in Step S17, the main scanning coordinate of a peak thatis within the range from the position the first reference distance REFn1to the right (to the positive direction) of the end position Hend of thenoise range W to the position the second reference distance REFn2 to theright (to the positive direction) of the end position Hend of the noiserange W is obtained; the range is from (Hstr+REFn1) to (Hstr+REFn2) inother words. In Step S18, the cutoff position (the end position Hpend ofthe target range R1) is defined as the main scanning coordinate of thepeak which is obtained in the previous step.

In yet another case, it is absolutely possible that two or more foreignparticles on the shading reference sheet 207 cause two or more noiseranges W and two or more target ranges R. For example, a first targetrange R11 and a second target range R12 are adjacent to each other asshown in FIG. 11. If the first target range R11 and the second targetrange R12 are subjected to data replacement separately, the process willbe complex. If the first target range R11, the second target range R12,and the normal range between the foregoing target ranges areconsolidated into one then subjected to data replacement at one time,the process will be simple, and data replacement in the normal rangewill hardly compromise the quality of shading correction.

So, it is preferred that, when the first target range R11 and the secondtarget range R12 are adjacent to each other, the first target range R11,the second target range R12, and the normal range between the foregoingtarget ranges be consolidated into one then subjected to datareplacement at one time.

Specifically, as shown in FIG. 11, there are four peaks: peaks P11, P12,P21, and P22. The start and end position of the first target range R11are defined as the main scanning coordinates of the peaks P11 and P12,and the start and end position of the second target range R12 aredefined as the main scanning coordinates of the peaks P21 and P22. Thepeak P12 on first target range R11 and the peak P21 on the second targetrange R12 are adjacent to each other. The main scanning coordinate ofthe peak P12 is obtained as a first coordinate, and the main scanningcoordinate of the peak P21 is obtained as a second coordinate. Thetarget range determination portion 133 judges whether or not thedifference between the first and second coordinate is equal to or belowa threshold. If it is equal to or below a threshold, the target rangedetermination portion 133 consolidates the first target range R11, thesecond target range R12, and the normal range between the foregoingtarget ranges, into one target range.

FIG. 12 is a flowchart representing a process of consolidating the firsttarget range R11, the second target range R12, and the normal rangebetween the foregoing target ranges into one target range.

In Step S21, the first target range R11 is determined; in Step S22, thesecond target range R22 is determined. Meanwhile, there are four peaks:peaks P11, P12, P21, and P22. The start and end position of the firsttarget range R11 are defined as the main scanning coordinates of thepeaks P11 and P12, and the start and end position of the second targetrange R12 are defined as the main scanning coordinates of the peaks P21and P22. The peak P12 on the first target range R11 and the peak P21 onthe second target range R12 are adjacent to each other. In Step S23, themain scanning coordinate of the peak P12 is obtained as a firstcoordinate; in Step S24, the main scanning coordinate of the peak P21 isobtained as a second coordinate.

In Step S25, it is judged whether or not the difference between thefirst and second coordinate is equal to or below a threshold. If it isequal to or below a threshold (YES in Step S25), the routine proceeds toStep S26 in which the first target range R11, the second target rangeR12, and the normal range between the foregoing target ranges areconsolidated into one target range.

In Step S25, if the difference between the first and second coordinateis not equal to or below a threshold (NO in Step S25), the routineterminates. Consequently, the first target range R11 and the secondtarget range R12 will be subjected to data replacement separately.

As described above, when the first target range R11 and the secondtarget range R12 are adjacent to each other, the first target range R11,the second target range R12, and the normal range between the foregoingtarget ranges are consolidated into one then subjected to datareplacement at one time. In contrast, it is preferred that, even whenthe first target range R11 and the second target range R12 are adjacentto each other, the first target range R11 and the second target rangeR12 be subjected to data replacement separately, on the condition thatthe first target range R11 and the second target range R12 showsignificantly different data characteristics.

It is therefore necessary to judge the difference in data characteristicbetween the first target range R11 and the second target range R12 asdescribed below. As shown in FIG. 13A, there are four peaks: peaks P11,P12, P21, and P22. The start and end position of the first target rangeR11 are defined as the main scanning coordinates of the peaks P11 andP12, and the start and end position of the second target range R12 aredefined as the main scanning coordinates of the peaks P21 and P22. Thepeak P11 on the first target range R11 and the peak P22 on the secondtarget range R12 are the most distant from each other. The main scanningcoordinate of the peak P11 is obtained as a third coordinate, and themain scanning coordinate of the peak P22 is obtained as a fourthcoordinate. As shown in FIG. 13B, the target range determination portion133 calculates a first amount of change that is the average of the shadevalues at positions adjacent to the third coordinate and a second amountof change that is the average of the shade values at positions adjacentto the fourth coordinate. The target range determination portion 133then judges whether or not the difference between the first and secondamount of change is equal to or below a threshold i.e. whether or notthe first target range R11 and the second target range R12 show similardata characteristics. On the condition that the difference between thefirst and second amount of change is equal to or below a threshold, thetarget range determination portion 133 consolidates the first targetrange R11, the second target range R12, and the normal range between theforegoing target ranges into one, as shown in FIG. 13D, when the firsttarget range R11 and the second target range R12 are adjacent to eachother. In contrast, on the condition that the difference between thefirst and second amount of change is not equal to or below a threshold,the target range determination portion 133 retains the first targetrange R11, the second target range R12, and the normal range between theforegoing target ranges without consolidating, as shown in FIG. 13C,even when the first target range R11 and the second target range R12 areadjacent to each other. The image forming apparatus is thus allowed tosuccessfully perform data replacement depending on the characteristic ofthe shading reference data SH1.

FIG. 14 is a flowchart representing a process of consolidating the firsttarget range R11, the second target range R12, and the normal rangebetween the foregoing target ranges into one on the condition that thefirst target range R11 and the second target range R12 show similarcharacteristics of the shading reference data SH1, when the first targetrange R11 and the second target range R12 are adjacent to each other.

Here, a detailed description on Steps S21 to S25 of this figure isomitted because these steps are the same as Steps S21 to S25 of FIG. 12.

In Step S25, if the difference between the first and second coordinateis not equal to or below a threshold (NO in Step S25), the routineterminates. If it is equal to or below a threshold (YES in Step S25),the routine proceeds to Step S31.

Meanwhile, multiple peaks are detected. The start and end position ofthe first target range R11 are defined as the main scanning coordinatesof the peaks P11 and P12, and the start and end position of the secondtarget range R12 are defined as the peaks P21 and P22. The peak P11 onthe first target range R11 and the peak P22 on the second target rangeR12 are more away from each other. In Step S31, the main scanningcoordinate of the peak P11 is obtained as a third coordinate; in StepS32, the main scanning coordinate of the peak P22 is obtained as afourth coordinate.

In Step S33, a first amount of change that is the average of the shadevalues at positions adjacent to the third coordinate is calculated; inStep S34, a second amount of change that is the average of the shadevalues at positions adjacent to the fourth coordinate.

In Step S35, it is judged whether or not the difference between thefirst and second amount of change is equal to or below a threshold. Ifit is equal to or below a threshold (YES in Step S35), the routineproceeds to Step S26 in which the first target range R11, the secondtarget range R12, and the normal range between the foregoing targetranges are consolidated into one target range.

In Step S35, if it is not equal to or below a threshold (NO in StepS35), the routine terminates. So, the first target range R11 and thesecond target range R12 will be subjected to data replacementseparately.

In this embodiment, the data replacement portion 140, shown in the blockdiagram of FIG. 3, replaces a part of data in the target range R1 with asubstitute part of data, which will be further described below.

First, a substitute pixel generator 141 generates a substitute part ofdata. While the method of generating a substitute part of data is notlimited to a specific one, it can be any of the following three methods,for example.

In the first method, the initial shading reference data SH0 obtained andstored in the early stage of use of the image forming apparatus is usedas to be described with reference to FIG. 15. Specifically, a part ofdata in the range corresponding to the target range R1 is retrieved fromthe initial shading reference data SH0 and embedded as a substitute partof data SH2.

In the second method, as shown in FIG. 16, a part of data in the rangecorresponding to a range other than the target range R1 in the shadingreference data (hereinafter to be also referred to as the uncorrectedshading reference data) SH1, but adjacent to the target range R1, suchas the target range R2, is retrieved from the initial shading referencedata SH0 and embedded as a substitute part of data SH2.

In the third method, as shown in FIG. 17, a part of data in the targetrange R1 is reshaped in a sine wave with reference to thecharacteristics of the uncorrected shading reference data SH1 and usedas a substitute part of data SH2. Specifically, the number of peaks andthe number of pixels from the rightmost to leftmost peak are countedfrom a predetermined range excluding the target range R1 in theuncorrected shading reference data SH1. The cycles of the sine-wave partof data in the predetermined range is calculated, and a dynamic range iscalculated from the maximum and minimum shade value in the sine-wavepart. A trigonometric function for generating a sine wave is thuscalculated. Using the trigonometric function, the initial phase shadevalue for a sine wave is calculated from the position of pixel countedfrom the start position of the target range R1 in the uncorrectedshading reference data SH1. The part of data in the target range R1 isthen reshaped in a sine wave such that it maintains the obtained cyclesand dynamic ranges until the end position of the target range R1.

A smoothing processor 142 performs a smoothing process on the substitutepart of data SH2 obtained in the above-described manner such that thesubstitute part of data SH2 and the uncorrected shading reference dataSH1 show approximately the same characteristics.

As previously mentioned, the uncorrected shading reference data SH1 haspossibly changed its characteristic because of a long-term use of thescanner unit 206, and it may slope upward or downward to the right, asshown in FIG. 18A. In this case, the shade value y10 at the start phaseof the target range R1 is not the same as the shade value y11 at the endphase of the target range R1, accordingly. Obviously, the shade valuey10 at the start phase of the target range R1 in the uncorrected shadingreference data SH1 is not the same as the shade value y20 at the startphase of the substitute part of data SH2, and the shade value y11 at theend phase of the target range R1 in the uncorrected shading referencedata SH1 is not the same as the shade value y21 at the end phase of thesubstitute part of data SH2. This means, there is discontinuity in shadevalue in the two boundaries between the uncorrected shading referencedata SH1 and the substitute part of data SH2. To smooth out thedifference in the shade values and ensure continuity in shade value inthe two boundaries between the uncorrected shading reference data SH1and the substitute part of data SH2, a smoothing process is performed.

There may be no affection yet by time-dependent deterioration. In thiscase, the shade value y10 at the start phase of the target range R1 isthe same as the shade value y11 at the end phase of the target range R1and there is no discontinuity in the two boundaries between theuncorrected shading reference data SH1 and the substitute part of dataSH2. In this case, no smoothing process is necessary.

Specifically, in a smoothing process, the shade value y10 and the shadevalue y11 at the start and end phase of the target range R1 in theuncorrected shading reference data SH1 are obtained, and the shade valuey20 and the shade value y21 at the start and end phase of the substitutepart of data SH2 are also obtained, and then shade value correction datais obtained by calculating y10/y20 and y11/y21.

Subsequently, the shade value correction data (coefficients), the numberN of pixels in the target range R1, and the position of pixel n countedfrom the start position of the target range R1 are substituted into thefollowing linear expression to evaluate the conversion rate T:{(y10/y20)×n+(y11/y21)×(N−n)}/N. FIG. 18B indicates the graph of theconversion rate T.

A multiplication processor 143 generates adjusted shading reference dataSH3 by multiplying the substitute part of data SH2 by the conversionrate T.

A selector 144 selects a part of data in the range excluding the rangecorresponding to the target range R1 from the uncorrected shadingreference data SH1, and also selects the adjusted shading reference dataSH3 obtained by the multiplication processor 143. The selector 144 theninput the selected data to a shading reference data generator 145. Byreplacing a part of data in the target range R1 in the uncorrectedshading reference data SH1 with the adjusted shading reference data SH3,the shading reference data generator 145 generates corrected shadingreference data SH4.

FIG. 19 is a flowchart representing a data replacement process to beperformed by the data replacement portion 140.

In Step S41, the uncorrected shading reference data SH1 is received; inStep S41, the initial shading reference data SH0 is obtained.

In Step S43, the substitute part of data SH2 is generated. The routinethen proceeds to Step S44, in which the shade values at the start andend position of the target range R1 in the uncorrected shading referencedata SH1 are obtained and the shade values at the start and end positionof the substitute part of data SH2 are also obtained.

In Step S45, the conversion rate T is calculated; in Step S46, theadjusted shading reference data SH3 is generated by multiplying thesubstitute part of data SH2 by the conversion rate T. In Step S47,corrected shading reference data SH4 is generated by replacing a part ofdata in the target range R1 in the uncorrected shading reference dataSH1 with the adjusted shading reference data SH3.

With reference to the corrected shading reference data SH4 obtained bythe shading reference data generator 145, shading correction will beperformed on the document image obtained by the data obtaining portion120. The shading correction method will not be described since it isalready a well-known technique. With reference to the corrected shadingreference data SH4, the image forming apparatus is thus allowed toperform shading correction without causing streaks on the documentimage, because the corrected shading reference data SH4 has continuousshade values adjacent to the start and end phase of the target range R1and the adjusted shading reference data SH3 in the target range R1 showsapproximately the same characteristic as the uncorrected shadingreference data SH1.

The present invention should not be limited to the above-describedembodiment. For example, in the above-described embodiment, the startposition Hpstr and the end position Hpend of the target range R1 aredefined as the main scanning coordinates of the peaks P1 and P2 of asine wave, which are to the right and left of the noise area W; however,the target range R1 should not be limited to what is defined in theabove-described embodiment. Alternatively, the target range R1 may beconstituted by the noise range W, as illustrated in FIG. 20, or may beconstituted by a certain range including the noise range W at least. Inthis case, as illustrated in FIG. 20, the shade value y10 at the startphase of the target range R1 in the uncorrected shading reference dataSH1 is not the same as the shade value y20 at the start phase of thesubstitute part of data SH2, and the shade value y11 at the end phase ofthe target range R1 in the uncorrected shading reference data SH1 is notthe same as the shade value y21 at the end phase of the substitute partof data SH2, as in the above-described embodiment. So, it is preferredthat a smoothing process be performed using the conversion rate T, whichwill smooth out the difference in the shade values and ensure continuityin shade value in the two boundaries between the uncorrected shadingreference data SH1 and the substitute part of data SH2.

Although one or more embodiments of the present invention have beendescribed and illustrated in detail, the disclosed embodiments are madefor purposes of illustration and example only and not limitation. Thescope of the present invention should be interpreted by terms of theappended claims.

What is claimed is:
 1. An image reading device comprising: a scanner that obtains image data by scanning an image, the scanner having characteristics of causing a distortion of gradation including a sine wave, the distortion of gradation being formed by the image data, the distortion of gradation being represented as an array of gradation values arranged in a main scanning direction; a reference member to be scanned by the scanner for shading correction; and a hardware processor that: obtains a gradation value at each main scanning position from shading reference data, the shading reference data obtained by the scanner from the reference member; determines a target range in the shading reference data based on the gradation value at the each main scanning position, the target range including a distorted waveform range in the shading reference data; generates a substitute part of data to be replaced for an original part of data in the target range; replaces the original part of data in the target range with the substitute part of data while the gradation values at the start and end phase of the substitute part of data are adjusted to the gradation values at the start and end phase of the target range in the shading reference data; and generates the substitute part of data by using a sine wave on the basis of a trigonometric function obtained from the shading reference data; wherein the hardware processor conducts data replacement by: creating the conversion formula for converting the substitute part of data; converting the substitute part of data by adjusting the gradation value at the each main scanning position of the substitute part of data using the conversion formula; and replacing the original part of data in the target range with the adjusted substitute part of data; and wherein the conversion formula is created by using coefficients and the number of pixels in the target range, the coefficients being calculated based on the ratio of the gradation value at the start and end phase of the target range in the shading reference data and the gradation value at the start and end phase of the substitute part of data.
 2. The image reading device according to claim 1, wherein a foreign particle on the reference member causes the distorted waveform range in the shading reference data.
 3. An image forming apparatus comprising the image reading device according to claim
 1. 4. A method of replacing a part of shading reference data for an image reading device, the image reading device comprising: a scanner that obtains image data by scanning an image, the scanner having characteristics of causing a distortion of gradation including a sine wave, the distortion of gradation being formed by the image data, the distortion of gradation being represented as an array of gradation values arranged in a main scanning direction; and a reference member to be scanned by the scanner for shading correction, the method comprising: obtaining a gradation value at each main scanning position from shading reference data, the shading reference data obtained by the scanner from the reference member; determining a target range in the shading reference data based on the gradation value at the each main scanning position, the target range including a distorted waveform range in the shading reference data; generating a substitute part of data to be replaced for an original part of data in the target range; and replacing the original part of data in the target range with the substitute part of data while the gradation values at the start and end phase of the substitute part of data are adjusted to the gradation values at the start and end phase of the target range in the shading reference data; wherein the substitute part of data is generated by using a sine wave on the basis of a trigonometric function obtained from the shading reference data; wherein the hardware processor conducts data replacement by: creating the conversion formula for converting the substitute part of data; converting the substitute part of data by adjusting the gradation value at the each main scanning position of the substitute part of data using the conversion formula; and replacing the original part of data in the target range with the adjusted substitute part of data; and wherein the conversion formula is created by using coefficients and the number of pixels in the target range, the coefficients being calculated based on the ratio of the gradation value at the start and end phase of the target range in the shading reference data and the gradation value at the start and end phase of the substitute part of data.
 5. The method of replacing a part of shading reference data according to claim 4, wherein a foreign particle on the reference member causes the distorted waveform range in the shading reference data.
 6. A non-transitory computer-readable recording medium storing a program to make a computer of an image reading device implement the method of replacing a part of shading reference data according to claim
 4. 